<script setup lang="ts">
import { onMounted } from 'vue'
import { useUserStore } from '@/store/modules/user'
import { useRouter } from 'vue-router'
import { storeToRefs } from 'pinia'
const $router = useRouter()
const userStore = useUserStore()
const { menuList } = storeToRefs(userStore)
onMounted(() => {
  userStore.fetUserMenuAction()
  console.log(menuList)
})
const menuItemClickHandle = (path: string) => {
  $router.push({
    path: '/user/' + path
  })
}
</script>
<template>
  <div class="user">
    <PageMenu
      :route-arr="menuList"
      @menu-item-click-handle="menuItemClickHandle"
    ></PageMenu>
  </div>
</template>
<style scoped lang="less">
.user {
  color: #666;
}
</style>
